#pragma once

/*--------------------------------------------------------------------------*/

struct EUbo
{
	enum Name
	{
	    General,
	    Material,
	    Light,
	    Matrices,
	    Camera,
	    Font,
	    Postprocess,
	    Commons,
	    Count
	};
};

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

struct EUboGeneral
{
	enum Name
	{
	    ScreenResolution = 0,
	    InvScreenResolution,
	    ScreenAspectRatio,
	    MousePosition
	};
};

static const GLUniformBufferItemDesc ubo_generalDesc[] =
{
	{ "ScreenResolution",			EUniformType::Float2		},
	{ "InvScreenResolution",		EUniformType::Float2		},
	{ "ScreenAspectRatio",			EUniformType::Float1		},
	{ "MousePosition",				EUniformType::Float2		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboMaterial
{
	enum Name
	{
	    MaterialDiffuse = 0,
	    MaterialShininess,
	    MaterialNormalMap
	};
};

static const GLUniformBufferItemDesc ubo_materialDesc[] =
{
	{ "MaterialDiffuse",			EUniformType::Float4		},
	{ "MaterialShininess",			EUniformType::Float1		},
	{ "MaterialNormalMap",			EUniformType::Float1		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboLight
{
	enum Name
	{
	    LightPosition = 0,
	    LightDiffuse,
	    LightRadius,
	    LightSpecularShininess,
	    LightDirection,
	    LightAngleCos
	};
};

static const GLUniformBufferItemDesc ubo_lightDesc[] =
{
	{ "LightPosition",				EUniformType::Float4		},
	{ "LightDiffuse",				EUniformType::Float4		},
	{ "LightRadius",				EUniformType::Float1		},
	{ "LightSpecularShininess",		EUniformType::Float1		},
	{ "LightDirection",				EUniformType::Float4		},
	{ "LightAngleCos",				EUniformType::Float1		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboMatrices
{
	enum Name
	{
	    ModelMatrix = 0,
	    ModelViewMatrix,
	    ModelViewProjectionMatrix,
	    ViewMatrix,
	    ProjectionMatrix,
	    InvProjectionMatrix,
	    InvViewProjectionMatrix,
	    ViewProjectionMatrix
	};
};

static const GLUniformBufferItemDesc ubo_matricesDesc[] =
{
	{ "ModelMatrix",				EUniformType::Float16	},
	{ "ModelViewMatrix",			EUniformType::Float16	},
	{ "ModelViewProjectionMatrix",	EUniformType::Float16	},
	{ "ViewMatrix",					EUniformType::Float16	},
	{ "ProjectionMatrix",			EUniformType::Float16	},
	{ "InvProjectionMatrix",		EUniformType::Float16	},
	{ "InvViewProjectionMatrix",	EUniformType::Float16	},
	{ "ViewProjectionMatrix",		EUniformType::Float16	},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboCamera
{
	enum Name
	{
	    CameraFarDistance,
	    CameraNearDistance,
	    WorldCameraPosition,
	};
};

static const GLUniformBufferItemDesc ubo_cameraDesc[] =
{
	{ "CameraNearDistance",			EUniformType::Float1		},
	{ "CameraFarDistance",			EUniformType::Float1		},
	{ "WorldCameraPosition",		EUniformType::Float4		},
	{ "",							EUniformType::Float1		},
};
/*--------------------------------------------------------------------------*/

struct EUboFont
{
	enum Name
	{
	    FontColor = 0,
	    OutlineRadius,
	    OutlineFactor
	};
};

static const GLUniformBufferItemDesc ubo_fontDesc[] =
{
	{ "FontColor",					EUniformType::Float4		},
	{ "OutlineRadius",				EUniformType::Float2		},
	{ "OutlineFactor",				EUniformType::Float1		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboPostprocess
{
	enum Name
	{
	    Var_0 = 0,
	    Var_1,
	    Var_2,
	    Var_3,
	    Var_4,
	    Var_5,
	    Var_6,
	    Var_7
	};
};

static const GLUniformBufferItemDesc ubo_postprocess[] =
{
	{ "Var_0",						EUniformType::Float4		},
	{ "Var_1",						EUniformType::Float4		},
	{ "Var_2",						EUniformType::Float4		},
	{ "Var_3",						EUniformType::Float4		},
	{ "Var_4",						EUniformType::Float4		},
	{ "Var_5",						EUniformType::Float4		},
	{ "Var_6",						EUniformType::Float4		},
	{ "Var_7",						EUniformType::Float4		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

struct EUboCommons
{
	enum Name
	{
	    Var_0 = 0,
	    Var_1,
	    Var_2,
	    Var_3,
	    Var_4,
	    Var_5,
	    Var_6,
	    Var_7
	};
};

static const GLUniformBufferItemDesc ubo_commons[] =
{
	{ "Var_0",						EUniformType::Float4		},
	{ "Var_1",						EUniformType::Float4		},
	{ "Var_2",						EUniformType::Float4		},
	{ "Var_3",						EUniformType::Float4		},
	{ "Var_4",						EUniformType::Float4		},
	{ "Var_5",						EUniformType::Float4		},
	{ "Var_6",						EUniformType::Float4		},
	{ "Var_7",						EUniformType::Float4		},
	{ "Var_8",						EUniformType::Float4		},
	{ "Var_9",						EUniformType::Float4		},
	{ "Var_A",						EUniformType::Float4		},
	{ "Var_B",						EUniformType::Float4		},
	{ "Var_C",						EUniformType::Float4		},
	{ "Var_D",						EUniformType::Float4		},
	{ "Var_E",						EUniformType::Float4		},
	{ "Var_F",						EUniformType::Float4		},
	{ "",							EUniformType::Float1		}
};

/*--------------------------------------------------------------------------*/

static const GLUniformBufferDesc g_uniformBuffersDesc[] =
{
	{ EUbo::General,		"ubo_general",		ubo_generalDesc		},
	{ EUbo::Material,		"ubo_material",		ubo_materialDesc	},
	{ EUbo::Light,			"ubo_light",		ubo_lightDesc		},
	{ EUbo::Matrices,		"ubo_matrices",		ubo_matricesDesc	},
	{ EUbo::Camera,			"ubo_camera",		ubo_cameraDesc		},
	{ EUbo::Font,			"ubo_font",			ubo_fontDesc		},
	{ EUbo::Postprocess,	"ubo_postprocess",	ubo_postprocess		},
	{ EUbo::Commons,		"ubo_commons",		ubo_commons			},
	{ EUbo::Count,			"",					NULL				}
};

/*--------------------------------------------------------------------------*/